#ifndef WIDGET_H
#define WIDGET_H

#include "mygraphicellipse.h"
#include "mygraphicline.h"

#include <QWidget>
#include <QGridLayout>
#include <QPushButton>
#include <QVBoxLayout>
#include <QGraphicsLayout>
#include <cmath>
#include <QVector>
#include <QPushButton>

class Widget : public QWidget
{
    Q_OBJECT

    QVector<MyGraphicLine*> lines;
    QVector<MyGraphicEllipse*> selectEllipses; // 当前被选中的圆
    QWidget* scene; // 显示图的界面

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();

public slots:
    void slotEllipseMove(QVector<int> indexs);
    void slotAddGraphic();
    void slotEllipseSelectChange(MyGraphicEllipse* ellipse, bool select);
    void slotDeleteEllipse();
    void slotAddEdge();

protected:
    void mousePressEvent(QMouseEvent *event) override;
};
#endif // WIDGET_H
